﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SpeechLib;

namespace OutputHandler
{
    /// <summary>
    /// Class for Text to Speech conversion.
    /// </summary>
    class TTS
    {
        private SpVoice speech;

        public TTS()
        {
            speech = new SpVoice();
        }

        public void say(String text)
        {
            //TODO: Maybe we'll need threading here because tts is blocking.
            
            
            /*
            foreach (ISpeechObjectToken Token in speech.GetVoices(string.Empty, string.Empty))
            {

                    speech.Voice = speech.GetVoices(string.Empty, string.Empty).Item(0);
                        
                        
            }
            */
            speech.Voice = speech.GetVoices(string.Empty, string.Empty).Item(0);
            speech.Speak(text, SpeechVoiceSpeakFlags.SVSFDefault);
            
        }
    }
}
